import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import Layout from '@/views/layout/index.vue'
import login from '@/views/login/index.vue'
import User from '@/views/user/index.vue'
import Goods from '@/views/goods/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Layout',
      component: Layout,
      children: [
        // {
        //   path: '',
        //   redirect: { name: 'Layout' }
        // },
        {
          path: '/user',
          name: 'User',
          component: User
        },
        {
          path: '/goods',
          name: 'Goods',
          component: Goods
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: login
    }
  ],
})

export default router
